import mySerivce from "@/request/myService"

export const addAction = (payload) => {
    return  {
      type: "ADD",
      payload
    }
}

export const addActionAsync=arg=>dispatch=>mySerivce({
      url: "http://localhost:3000/inc",
      params:{
        id:arg
      }
    }).then(res => {
      dispatch({
        type: "ADD",
        payload:res.data.num
      })
    })








export const subAction = (payload) => ({
  type: "SUB",
  payload
})


export const addBookAction = (payload) => {
  return  {
    type: "ADDBOOK",
    payload
  }
}


export const delBookAction = (payload) => {
  return  {
    type: "DELBOOK",
    payload
  }
}
